package com.example.demo.mapper;

import com.example.demo.domain.Reserve;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface ReserveMapper {
        //查询所有预定订单
        @Select("select * from reserve")
        List<Reserve> findAllReserve();

        //删除预定订单信息
        @Delete("delete from reserve where id=#{id}")
        int deleteReserve(Integer id);

        //添加预定订单信息
        @Insert("insert into reserve(room_No,user_name,Start_time,End_time) values (#{roomNo},#{userName},#{startTime},#{endTime})")
        int addReserve(Reserve reserve);

        //修改预定订单信息
        @Update("update reserve set room_No=#{roomNo},user_name=#{userName},Start_time=#{startTime},End_time=#{endTime} where id=#{id}")
        int updateReserve(Reserve reserve);

        //查询预定订单信息
        List<Reserve> findReserve(Reserve reserve);
}
